<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUserTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		
		if (Schema::hasTable('users'))
		{
			Schema::drop('users');
		}
		
		Schema::create('users', function(Blueprint $table)
		{
			$table->increments('id');
			
			$table->string('name', 32);
			$table->string('username',32)->unique();
			$table->string('email', 32)->unique();
			$table->string('password', 64);
			
			$table->string('ip4',20);
			$table->string('city',90);

			$table->tinyInteger('charslot')->default(3);//Char Slot
			$table->string('api',100);
			
			$table->string('remember_token', 100)->nullable();			
			$table->timestamps();
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		Schema::drop('users');
	}

}
